<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed!');

class Dashboard extends OC_Controller {

	function __construct()
	{
		parent::__construct(array(
			'login_check' => TRUE
		));

		$this->load->model('dashboard_model', 'get_db');
	}

	function _remap($method, $params = array())
	{
		parent::_remap($method, $params);

		if (method_exists($this, $method))
			return call_user_func_array(array($this, $method), $params);
		else
			show_404();
	}

	function init_header()
	{

		$this->header['jeasyui']		= FALSE;
		/*$this->header['source_bot']		= array(
			script_tag(site_url('members/themescript/chart/highcharts.js')),
			script_tag(site_url('members/themescript/chart/modules/exporting.js')),
			script_tag(site_url('members/themescript/chart/addons.js'))
		);
		$this->header['last_member']	= 'last_member';
		$this->header['last_events']	= 'last_events';
		$this->header['last_saldo']		= 'last_saldo';*/
	}

	function index()
	{
		$this->init_header();

		$this->header['nav']			= 'dashboard';
		$this->header['pagetitle']		= 'Dashboard';
		$this->header['last_articles']    = $this->get_db->get_last_articles();
		$this->header['last_products']    = $this->get_db->get_last_products();
		$this->view('dashboard/dashboard_view');
	}
}